package cn.swh.guguanjia.mapper;

import org.apache.ibatis.jdbc.SQL;
import org.springframework.util.StringUtils;

import java.util.Map;

/**
 * @Author: swh
 * @Description:
 * @Date: 2020/11/9 20:00
 * @Version: 1.0
 */
public class SysLogProvider {
    public String selectPage(Map<String, Object> map) {
        return new SQL() {{
            SELECT("*");
            FROM("sys_log");
            if (map.containsKey("type") && !StringUtils.isEmpty(map.get("type"))) {
                WHERE("type=#{type}");
            }
        }}.toString();
    }
}
